<?php
class PropertyTest
{
  public $data = array();
  public function __set($name, $value){

    echo "I am in __set()\n\n";
    $this->data[$name] = $value;
  }

  public function __get($name){
    echo "I am in __get()\n\n";
    return $this->data[$name];
  }

  public function __isset($name){
    echo "I am in __isset()\n\n";
    return isset($this->data[$name]);
  }

  public function __unset($name) {
    echo "I am in __unset()\n\n";
    unset($this->data[$name]);
  }
}

$obj = new PropertyTest;
$obj->num = 1;//setting
exit;
exit;
echo $obj->num;
var_dump(isset($obj->num));
unset($obj->num);
echo $obj->num;
